<?php
$username=$_POST['username'];
$password=$_POST['password'];
include './connect.php';
$sql ="SELECT * FROM `users` WHERE `username`='$username'";
$row =mysqli_query($link,$sql);
$res=mysqli_fetch_assoc($row);
if($res){
    if($password==$res['password']){
        $arr =["statu"=>2,"msg"=>"登录成功"];
    }
    else{
        $arr =["statu"=>1,"msg"=>"密码错误"];
    };
}
else{
    $arr =["statu"=>0,"msg"=>"账号不存在"];
};
echo json_encode($arr);